package com.todo1.unit_testing.dto;

import java.util.List;

public class OrderDto {

	private List<ItemDto> detail;
	
	private String customerId; 

	public List<ItemDto> getDetail() {
		return detail;
	}

	public void setDetail(List<ItemDto> detail) {
		this.detail = detail;
	}
	
	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	public double getTotal() {
		double orderTotal = 0;
		for(ItemDto item: getDetail()) {
			orderTotal += item.getProduct().getPrice() * item.getQuantity();
		}
		
		return orderTotal;
	}
	
}
